<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
	String applicationPath = basePath + "/" + "application";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的工作台</title>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/jinmu_style.css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script language="javascript" src="<%=applicationPath%>/js/main.js"></script>
</head>
<body>
<html:form styleId="workBenchForm" action="workBench.do" styleClass="simple">
 <html:hidden property ="type" styleId="type"/>
	    <input type="hidden" id="workitemID" name="workitemID" value=""/>
	    <html:hidden property ="typeName" styleId="typeName"/>
<html:hidden property ="bussinessID" styleId="bussinessID"/>
<html:hidden property ="instanceID" styleId="instanceID"/>
<table width="98%" cellspacing="0" cellpadding="0" align="center" border="0" class="margtb5">
  <tr>
    <td width="50%" align="left" valign="top" class="padr5">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr>
		  <td class="kuang1"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
			<tr>
			  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
			    <c:if test="${loginUser.isZJL =='true'}">
			        <td width="80%" align="left" class="bai13bold">项目审批</td>
				</c:if>
				<c:if test="${loginUser.isZJL !='true'}">
			        <td width="80%" align="left" class="bai13bold">待办事宜</td>
				</c:if>
			  
			  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreTodoList();">更多...</a></td>
			</tr>
			<tr>
			  <td colspan="3" class="pad5 hei12">  
             <% int count = 0;%>
              <logic:present name="workItemsList">
		     <logic:iterate id="workitem" name="workItemsList">
		        <c:if test="${loginUser.isZJL =='true'}">
				<a href="#" onclick="showView('${workitem.bussId}','${workitem.bussType}','${workitem.processinstanceId}');">【<ssh:select propertyName="bussType" pid="BUSS_TYPE"  type="3" defaultName="${workitem.bussType}"/><bean:write name="workitem" property="title" filter="false"/>】${workitem.projectName}</a>
				</c:if>
				<c:if test="${loginUser.isZJL !='true'}">
				<a href="#" onclick="showContent('${workitem.id}','${workitem.yfbussTaskType}');">【<ssh:select propertyName="bussType" pid="BUSS_TYPE" type="3" defaultName="${workitem.bussType}"/><bean:write name="workitem" property="title" filter="false"/>】${workitem.projectName}</a>
				</c:if>
				<br/>
		     <% count++; %>
             </logic:iterate>
             </logic:present>
               <% 
                    int s = 10-count;
                    if(s>0){
                        for(int i=0;i<s;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
                %>
             </td>
			</tr>
		  </table></td>
	    </tr>
	  </table>
	</td>
	<td width="50%" align="left" valign="top" class="kuang1">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
	    <tr>
		  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
		  <td width="80%" align="left" class="bai13bold">已办事宜</td>
		  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreCompleteList();">更多...</a></td>
	    </tr>
	    <tr>
		  <td colspan="3" class="pad5 hei12"> 
		     <% int count2 = 0;%>
		      <logic:present name="workItemsHisList">
		     <logic:iterate id="workitem" name="workItemsHisList">
				<a href="#" onclick="view('${workitem.id}');">【<ssh:select propertyName="bussType" pid="BUSS_TYPE" type="3" defaultName="${workitem.bussType}"/>】${workitem.projectName}</a>
				<br/>
		     <% count2++; %>
             </logic:iterate>
             </logic:present>
               <% 
                    int s2 = 10-count2;
                    if(s2>0){
                        for(int i=0;i<s2;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
            %></td>
	    </tr>
	  </table>
	</td>
  </tr>
</table>
<table width="98%" cellspacing="0" cellpadding="0" align="center" border="0">
  <tr>
    <td width="50%" align="left" valign="top" class="padr5">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr>
		  <td class="kuang1"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
			<tr>
			  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
			  <td width="80%" align="left" class="bai13bold">通知公告</td>
			  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreNotice();">更多...</a></td>
			</tr>
			<tr>
  <td colspan="3" class="pad5 hei12">
			    <% int count3 = 0;%>
			     <logic:present name="noticeList">
			    <logic:iterate id="notice" name="noticeList">
		          <a href="#" onclick="showNotice('<bean:write name="notice" property="id"/>');">【通知公告】<bean:write name="notice" property="noticeTitle"/></a></br>
		          <% count3++; %>
                </logic:iterate>
                </logic:present>
                <% 
                    int s3 = 10-count3;
                    if(s3>0){
                        for(int i=0;i<s3;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
                %>
			  </td>
			</tr>
		  </table></td>
	    </tr>
	  </table>
	</td>
	<td width="50%" align="left" valign="top" class="kuang1">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
	    <tr>
		  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
		  <td width="80%" align="left" class="bai13bold">任务指派预警</td>
		  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreWarning();">更多...</a></td>
	    </tr>
	    			<tr>
                <td colspan="3" class="pad5 hei12">

			    <% int count4 = 0;%>
			    <logic:present name="earlyWarningList">
			    <logic:iterate id="earlyWarning" name="earlyWarningList">
		         <a href="#" onclick="showContent('${earlyWarning.id}','${earlyWarning.yfbussTaskType}');"><font color="red">【<ssh:select propertyName="bussType" pid="BUSS_TYPE" type="3" defaultName="${earlyWarning.bussType}"/>】${earlyWarning.projectName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;指派人：${earlyWarning.rname}&nbsp;&nbsp;任务截止时间：<bean:write name="earlyWarning" property="completeDate" format="yyyy-MM-dd"/></font></a>
		         <br>
		          <% count4++; %>
                </logic:iterate>
                </logic:present>
                <% 
                   // int s4 = 10-count4;
                   int s4 = 7-count4;
                    if(s4>0){
                        for(int i=0;i<s4;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
                %>
                 
			  </td>
			  
			  
			</tr>
	  </table>
	</td>
  </tr>
</table>
</html:form>
</body>
<script>


function openMain(actorId){
  	var url = "<%=path%>/enterWorkBench.do?method=enterWorkBench&actorId=" + actorId;
	window.location = url;
}



//查看具体信息
function showContent(workitemID,type){
    $("workitemID").value = workitemID;
    $("type").value = type;
	document.forms[0].action="openForm.do?method=openForm";
	document.forms[0].submit();
}

function view(workitemID){
    $("workitemID").value = workitemID;
	document.forms[0].action="workBench.do?method=goToBussinessView";
	document.forms[0].submit();
}

function showView(bussId,bussType,processId){
    $("bussinessID").value = bussId;
    $("typeName").value = bussType;
    $("instanceID").value = processId;
	document.forms[0].action="workBench.do?method=goToBussinessViewZJL";
	document.forms[0].submit();
}




//查看通知
function showNotice(id){ 
    document.forms[0].action="workBench.do?method=showNotice&bussinessID=" + id;
	document.forms[0].submit();
    /**var url = "workBench.do?method=showNotice&bussinessID=" + id;
    openWindow(url,1000,600);**/
}

//通知公告列表
function moreNotice(){
	var url = "<%=path%>/listNotice.do?&method=getNoticePartialList";
	window.location = url;
}

//代办列表
function moreTodoList(){
	var url = "<%=path%>/listWorkItem.do?method=getWorkItemList";
	window.location = url;
}

//已办列表
function moreCompleteList(){
	var url = "<%=path%>/listWorkItemHis.do?method=getWorkItemHisList";
	window.location = url;
}

//预警列表
function moreWarning(){
   var url = "<%=path%>/listWarning.do?method=getWarningList";
   window.location = url;
}

//预警提示信息
function viewWarningDetail(bussinessID,type,inputtimeStr){
    var url ="workBench.do?method=operaterEarlyWarning&bussinessID="+bussinessID+"&type=" + type + "&inputtimeStr=" + inputtimeStr;
	var returnValue = showDialog(url);
	/**
	if(returnValue == 1){
	    window.location.reload();
	}
    **/
}
</script>

</html>